Add serverFunctions.components: 'external' for hosts that own the document wiring - #341
Merged
Conversation
…ument wiring Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: cf13314 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #340
serverFunctions.componentsnow accepts'external'alongside booleans. It behaves exactly liketrueeverywhere (same transforms, same codegen — every derivedserverComponentsflag is truthiness-based, so'external'flows as enabled), but declares that a composing host (the Astro adapter, TanStack Start's Solid integration) owns the document wiring — render plugin + client-sideinstallServerComponents()call — itself, so theconfigResolvedwithout-SSR-start-mode warning is skipped. Under full SSR start mode it's redundant but harmless: treated exactly astrue, no redundancy warning.Also fixes the stale warning text for the remaining
truepath: it still listed "the bootstrap script" as a required app-side piece, but head bootstrap injection was removed (serialized server-component references self-bootstrap the registry). The message now names the render plugin (with the direct-call transform) andinstallServerComponents(), and points hosts atcomponents: 'external'.src/server-functions/index.ts: widen the option type, refresh the JSDocsrc/index.ts: skip the warning on'external', reword the messageREADME.md: document'external'in the server-components section (reuses theexternalvocabulary, cf.start.external).changeset/server-components-external.md: patch changesetexamples/start-ssr/test/components-warning.mjs(chained into the suite's test script): config-level assertions thattruewarns with the updated text (no "bootstrap" mention, mentions'external'),'external'is silent yet still enabled (serve-time pre-bundle of the server-components runtime matchestrue), off stays off, and'external'under SSR start mode is silentLocal gate:
pnpm build(rollup + tsc) green,node test/components-warning.mjs9/9,node test/run.mjs frames61/61.Made with Cursor